<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>5
<script>
    var hum = parseInt(prompt('请输入一个正整数'))
    var num = hum
    for(var i = num-1; i>0; i--){
       var num = num * i
    }
    document.write(hum+'的阶乘是：'+num);
</script>
</html>